#include "InLiteral.h"

InLiteral::InLiteral(Scope* in_pxParent, char in_cStartChar)
{
    m_pxParent = in_pxParent;
    m_eType = Scope::eScopeLiteral;
    m_cLookAhead = '\0';
    m_cEnder = in_cStartChar;
}

InLiteral::~InLiteral(void)
{
}

Scope* InLiteral::process(Token& inToken, bool &bIsEndOfScope)
{
    char cDelimiter = char(inToken);

    bIsEndOfScope=false;
    if(inToken.m_bIsDelimiter)
    {
        if(m_cEnder == cDelimiter)
        {
            if('\\'!=m_cLookAhead)
                bIsEndOfScope= true;
        }
    }

	// Handle escaped '\'s 
	// NJFIND '\\' fix
    if(('\\' == cDelimiter) && ('\\' == m_cLookAhead))
	{
		m_cLookAhead = '\0';
	}
	else
	{
		m_cLookAhead = cDelimiter;
	}

    m_asWorkspace.push_back(inToken.m_sValue);
    return NULL;

}
